package net.hn.hnms.biz.intelligence.vo;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import lombok.Data;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * 矿历史-测点值变化(API)
 *
 * @author baishujuan
 * @version 1.0
 * @date 2019/12/7 9:29
 * @since
 */
@Data
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE)
public class ChartSensorValueVO {

    /**
     * 时间
     */
    private List<String>     xName;
    /**
     * 值
     */
    private List<BigDecimal> pointValue;
    private List<BigDecimal> maxPointValue;
    private List<BigDecimal> minPointValue;
    private List<String>pointStatus;
    private List<String>pointStatusName;
    private List<SensorValuesVO>sensorValuesVO;

    public ChartSensorValueVO() {
        xName = new ArrayList<>();
        pointValue = new ArrayList<>();
        maxPointValue = new ArrayList<>();
        minPointValue = new ArrayList<>();
        pointStatus=new ArrayList<>();
        pointStatusName=new ArrayList<>();
    }

    public ChartSensorValueVO(List<PointValueChartBO> pointValueChartBOList, List<SensorValuesVO> sensors) {
        xName = new ArrayList<>();
        pointValue = new ArrayList<>();
        maxPointValue = new ArrayList<>();
        minPointValue = new ArrayList<>();
        pointStatus=new ArrayList<>();
        pointStatusName=new ArrayList<>();
        pointValueChartBOList.forEach(
                x -> {
                    xName.add(x.getDataTime());
                    pointValue.add(x.getPointValue());
                    maxPointValue.add(x.getMaxPointValue());
                    minPointValue.add(x.getMinPointValue());
                    pointStatus.add(x.getPointStatus());
                    pointStatusName.add(x.getPointStatusName());
                }
        );
        this.sensorValuesVO=sensors;
    }

}
